package nl.infodation.emr.utility;

import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Button.ClickListener;

public class ListenerUtil {

	static public void addValueChangeListenerToTextField(TextField textField,
			ValueChangeListener valueChangeListener) {
		textField.setImmediate(Boolean.TRUE);
		textField.addListener(valueChangeListener);
	}

	static public void addClickListenerToCheckBox(CheckBox checkBox,
			ClickListener clickListener) {
		checkBox.setImmediate(Boolean.TRUE);
		checkBox.addListener(clickListener);
	}

	static public void addValueChangeListenerToComboBox(ComboBox comboBox,
			ValueChangeListener valueChangeListener) {
		comboBox.setImmediate(Boolean.TRUE);
		comboBox.addListener(valueChangeListener);
	}
	
}
